const config = require('../config/mysql_conf');
const mysql = require('mysql');
const Bluebird = require('bluebird');
let client = mysql.createPool(config);

module.exports = function() {
    return new Bluebird((resolve, reject) => {
        client.getConnection((err, connection) => {
            if (err) reject(err);
            else resolve(connection);
        });
    });
};